<?php

namespace app\api\library\Exception;


use Throwable;

class DataMissException extends BaseException
{
    public $code = -1;
    public $msg = '数据查询不到';
    public $errCode = 200;

    public function __construct($exception = [], $code = 0, Throwable $previous = null)
    {
        parent::__construct($exception);
        $msg = $exception->getMessage();

        if (strpos($msg,'model data Not Found') === false){
            $this->msg = [
                'file' => $exception->getFile(),
                'line' => $exception->getLine(),
                'msg' => $msg,
            ];
            $this->errCode = 500;
        }
    }
}
